<!DOCTYPE html>
<html>

@include('public/header')

<body class="gray-bg">
<div class="wrapper wrapper-content  animated fadeInRight article">
    <div class="row">
        <div class="col-lg-10 col-lg-offset-1">
            <div class="ibox">
                <div class="ibox-content">
                    <div class="pull-right">
                        @foreach($data['parent_type_name'] as $k => $v)
                        <button class="btn btn-white btn-xs" type="button">{{$v}}</button>
                        @endforeach
                    </div>
                    <div class="text-center article-title">
                        <h2 style="font-weight:bold">
                            {!! $data['desc'] !!}
                        </h2>
                    </div>
                    <h3 style="font-weight:bold">
                        原因：
                    </h3>
                    <span>{!! $data['reason'] !!}</span>
                    <div style="height:30px;"></div>
                    <h3 style="font-weight:bold">
                        方法：
                    </h3>
                    <span>{!! $data['method'] !!}</span>
                    <div style="height:30px;"></div>
                    <h3 style="font-weight:bold">
                        备注：
                    </h3>
                   <span>{!! $data['content'] !!}</span>
                    <div style="height:30px;"></div>

                    <div class="row">
                        <div class="col-lg-12">
                            @if(isset($data['picture']) && !empty($data['picture']))
                            <h2>示例图片：</h2>
                            <div class="ibox-content">
                                <div class="social-feed-box">
                                    <div class="social-avatar">
                                            @foreach($data['picture'] as $k => $v)
{{--                                                <a href="img/p1.jpg" class="pull-left" >--}}
                                                    <a class="fancybox" href="#" title="图片1">
                                                    <img alt="image" src="{{$v}}" style="width: 120px;height: 120px;"  onclick="Big(this)">
                                                </a>
                                            @endforeach
                                    </div>
                                </div>
                            </div>
                            @endif
                        </div>

                    </div>


                </div>
            </div>
        </div>
    </div>

</div>

<script>
    $(document).ready(function () {
        $('.fancybox').fancybox({
            openEffect: 'none',
            closeEffect: 'none'
        });
    });
</script>
<script>
    function Big(obj){
        var imgsrc = obj.src;
        var opacityBottom = '<div id="opacityBottom" style="display: none"><img class="bigImg" src="'+ imgsrc +'" ></div>';
        $(document.body).append(opacityBottom);
        toBigImg();//变大函数
    }


    function toBigImg(){
        $("#opacityBottom").addClass("opacityBottom");
        $("#opacityBottom").show();
        $("html,body").addClass("none-scroll");//下层不可滑动
        $(".bigImg").addClass("bigImg");
        /*隐藏*/
        $("#opacityBottom").bind("click",clickToSmallImg);
        $(".bigImg").bind("click",clickToSmallImg);
        var imgHeight = $(".bigImg").prop("height");
        if(imgHeight < h){
            $(".bigImg").css({"top":(h-imgHeight)/2 + 'px'});
        }else{
            $(".bigImg").css({"top":'0px'});
        }
        function clickToSmallImg() {
            $("html,body").removeClass("none-scroll");
            $("#opacityBottom").remove();
        }
    };
</script>

@include('public/footer')

</body>
<style>
    /*全屏显示大图*/
    .opacityBottom{
        width: 100%;
        height: 100%;
        position: fixed;
        background:rgba(0,0,0,0.8);
        z-index:1000;
        top: 0;
        left: 0
    }
    .none-scroll{
        overflow: hidden;
        height: 80%;
    }
    .bigImg{
        width:60%;
        height: 60%;
        left:20%;
        top:20%;
        position:fixed;
        z-index: 10001;
    }
</style>
</html>
